<?php
class User extends AppModel {
// Define the model and it's associations:
var $name = 'User';
var $hasMany = array(
					'Pothole' => array(
						'className' => 'Pothole',
						'foreignKey' => 'user_ID',
						'dependent' => 'true'
						),
					'Rating' => array(
						'className' => 'Rating',
						'foreignKey' => 'user_ID',
						'dependent' => 'true'
						),
					'Comment' => array(
						'className' => 'Comment',
						'foreignKey' => 'user_ID',
						'dependent' => 'true'
						)
					);
	/*
	/	fetchUserInfoByName: fetch Town information by it's name
	/	string $user: user name
	*/
	public function fetchUserInfoByName($user) {
		$userinfo = $this->find('first', array(
			'conditions' => array(
				'User.name' => $user)/*,
			'fields' => array(
				'Metro.ID')*/));
		return $userinfo;
	}
}
?>
